import { _decorator, Component, Node } from 'cc';
import { ModuleMgr } from './ModuleMgr';
const { ccclass, property } = _decorator;

@ccclass('ModuleBase')
export class ModuleBase extends Component {
    //供派生类重写。
    onInit(...rest:any[]){

    }

    onLateInit(...rest:any[]){

    }
    onUpdate(dt:number,...rest:any[]){

    }

    onLateUpdate(dt:number,...rest:[]){
        
    }

    //默认响应函数
    handleMsg(...rest:any[]){

    }
    //方便，以后派生类需要处理交互可以直接调用 this.send
    sendMsg(msgName:string,moduleName?:string,...rest:any[]){
        ModuleMgr.instance.sendMsg.apply(ModuleMgr.instance,arguments);
    }
}


